package com.cmz.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @author summer
 * @create 2020-02-11 18:28
 *
 * 读取配置文件 k-v
 */
public class PropertMgr {
    static Properties props = new Properties();
    static{
        try {
            props.load(PropertMgr.class.getClassLoader().getResourceAsStream("config"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key){
        if(props == null) return null;
        return props.get(key);
    }

    public static void main(String[] args) {
        System.out.println(PropertMgr.get("initTankCount"));
    }
}
